package com.earl.eatbao.service;

import com.earl.eatbao.commons.service.BaseService;
import com.earl.eatbao.domain.eatbao.GoodsVo;
import com.earl.eatbao.domain.eatbao.OrderDetail;
import com.earl.eatbao.domain.eatbao.Orders;
import com.pingplusplus.model.Charge;
import org.springframework.data.domain.Page;

import java.util.List;

public interface OrdersService extends BaseService<Orders, Long>{

    /**
     * 商家查询商店的所用订单
     * @param shopUserId
     * @return
     */
    List<Orders> findShopAllOrders(Long shopUserId);

    /**
     * 用户下单
     * @param orders
     * @param  goodsList
     * @param addressId
     * @return
     */
    Boolean placeOrder(Orders orders, List<GoodsVo> goodsList, Long addressId);

    /**
     *  商家接单
     * @param ordersId 订单ID
     */
    Boolean acceptOrders(Long ordersId);

    /**
     * 商家拒绝接单
     * @param ordersId 订单ID
     */
    Boolean refuseOrders(Long ordersId);

    /**
     * 商家发货
     * @param orderId
     * @return
     */
    Boolean deliverOrders(Long orderId);

    /**
     *  用户申请退单
     * @param ordersId 订单ID
     * @return
     */
    Boolean rebackOrders(Long ordersId);

    /**
     * 完成订单,用户确认收货
     * @param orderId 订单ID
     * @return
     */
    Boolean doneOrders(Long orderId);

    /**
     * 评论订单
     * @param orderId  订单ID
     * @return
     */
    Boolean commentOrders(Long orderId);

    /**
     * 获取所用订单
     * @param pageIndex
     * @param size
     * @return
     */
    Page<Orders> getAllOrders(Integer pageIndex, Integer size);

    /**
     * 获取指定状态的订单
     * @param status
     * @return
     */
    List<Orders> findOrdersByStatus(Integer status);

    /**
     *
     * @param userId
     * @return
     */
    List<Orders> findUserAllOrders(Long userId);

    /**
     * 获取订单详情
     * @param ordersId
     * @return
     */
    List<OrderDetail> getOrdersInfo(Long ordersId);

	List<Orders> findShopUnWatchOrder(Long userId);

    /**
     * 支付
     * @param ordersId 订单号
     * @param payWay 支付方式
     * @return
     */
    Charge payOrders(Long ordersId, String payWay);

    /**
     * 支付回调接口
     * @param orderId
     * @return
     */
    Boolean callBackPayOrders(Long  orderId);

	List<Orders> findUserUnGetOrders(Long userId);

	List<Orders> findUserUnCommentOrders(Long userId);

	/**
	 * 用户确认收货
	 * @param ordersId
	 * @return
	 */
	Boolean userConfirmGetOrders(Long ordersId);

	List<Orders> findShopUnSendOrder(Long shopperId);

	List<Orders> userUnpayOrders(Long userId);
}
